package com.ymatou.apigateway.testcase;

import java.math.BigDecimal;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.apigateway.parameter.AesUtil;
import com.ymatou.apigateway.parameter.OpenApiGetOrderReq;
import com.ymatou.apigateway.parameter.OpenapiReq;
import com.ymatou.apigateway.service.OpenapiService;
import com.ymatou.apigateway.service.V1getorderCall;
import com.ymatou.iapi.optrade.parameter.enums.LogisticsTypeEnum;
import com.ymatou.iapi.optrade.resp.TradingServiceResp;
import com.ymatou.iapi.trading.operate.parameter.PlaceOrderResp;
import com.ymatou.iapi.trading.operate.parameter.PlaceOrderService;
import com.ymatou.iapi.trading.ordersync.parameter.OrderBean;
import com.ymatou.iapi.trading.ordersync.service.SyncVerifyService;
import com.ymt.base.YmatouEasyCall;
import com.ymt.core.tool.FormatUtil;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymttest.business.service.OrderCallService;
import com.ymttest.business.service.YMTTrading.TradingCallService;
import com.ymttest.business.service.YMTTrading.TradingPlaceOrderCallService;
import com.ymttest.database.model.Application;
import com.ymttest.database.model.AuthCode;
import com.ymttest.database.sqlwapper.OpenApiWapper;
import com.ymttest.utils.DataUtil;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.YMTDateUtil;

/**
 * openapi获取订单详情FreeMaker Template自动生成代码
 */
@TestSuite
public class Ts_v1getorderdetail {
	private static OpenapiReq openapiReq;
	private static V1getorderCall v1getorderlistCall;
	private static OpenApiWapper openApiWapper;
	private static OpenApiGetOrderReq openApiGetOrderReq;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("openapi获取订单详情");
		//stag 环境注释掉
		openApiWapper = new OpenApiWapper();

	}

	@Before
	public void caseUp() {

		openapiReq = new OpenapiReq();
		openApiGetOrderReq = new OpenApiGetOrderReq();
		v1getorderlistCall = new V1getorderCall();
		openapiReq.setMethod("ymatou.order.detail.get");

	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(v1getorderlistCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_V1getorderdetail_000() {
		Logger.start(true, "openapi获取订单详情 指定orderid");
		try {

			long orderId = 11417798699L;

			int sellerId = 24635724;

			openApiGetOrderReq.setOrder_id(orderId);

			Application application = openApiWapper
					.selectApplicationBySellerId(Long.valueOf(sellerId)).get(0);

			String app_id = application.getApp_id();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);

			String app_secret = application.getApp_secret();

			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(openApiGetOrderReq));
			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.order.detail.get",
							app_id);

			v1getorderlistCall.setUrl(url);

			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			v1getorderlistCall.setData(openapiReq);

			v1getorderlistCall.callService();

			Logger.verifyEquals("0000", v1getorderlistCall.getCode(), "校验code");
			Logger.verifyEquals("", v1getorderlistCall.getMsg(),
					"校验message");

			Logger.verifyNotNull(v1getorderlistCall.getContent(), "校验content");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_V1getorderdetail_001() {
		Logger.start(true, "openapi获取订单详情");
		try {

			PlaceOrderResp placeOrderResp = OpenapiService.placeOrderAndPaid();

			int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
			int orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			openApiGetOrderReq.setOrder_id(orderId);

			Logger.comment("userid:" + sellerId);
			Application application = openApiWapper
					.selectApplicationBySellerId(Long.valueOf(sellerId)).get(0);

			String app_id = application.getApp_id();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);

			String app_secret = application.getApp_secret();

			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(openApiGetOrderReq));
			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.order.detail.get",
							app_id);

			v1getorderlistCall.setUrl(url);

			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			v1getorderlistCall.setData(openapiReq);

			v1getorderlistCall.callService();

			Logger.verifyEquals("0000", v1getorderlistCall.getCode(), "校验code");
			Logger.verifyEquals("null", v1getorderlistCall.getMsg(),
					"校验message");

			Logger.verifyNotNull(v1getorderlistCall.getContent(), "校验content");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_V1getorderdetail_011() {
		Logger.start(true, "openapi 订单发货后,获取订单详情");
		try {

			PlaceOrderResp placeOrderResp = PlaceOrderService.dispatchedOrder();

			int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
			int orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			PlaceOrderService.saveDeliverSummary(orderId, sellerId,
					TestDataManager.getRandomNum(8).toString());

			PlaceOrderService.saveDeliverSummary(orderId, sellerId,
					TestDataManager.getRandomNum(8).toString());

			PlaceOrderService.saveDeliverSummary(orderId, sellerId,
					TestDataManager.getRandomNum(8).toString());

			SyncVerifyService.getSyncResult(orderId);

			Thread.sleep(1000);

			openApiGetOrderReq.setOrder_id(orderId);
			openApiGetOrderReq.setNeeds_delivery_info(true);

			Logger.comment("userid:" + sellerId);
			Application application = openApiWapper
					.selectApplicationBySellerId(Long.valueOf(sellerId)).get(0);

			String app_id = application.getApp_id();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);

			String app_secret = application.getApp_secret();

			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(openApiGetOrderReq));
			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.order.detail.get",
							app_id);

			v1getorderlistCall.setUrl(url);

			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			v1getorderlistCall.setData(openapiReq);

			v1getorderlistCall.callService();

			Logger.verifyEquals("0000", v1getorderlistCall.getCode(), "校验code");
			Logger.verifyEquals("null", v1getorderlistCall.getMsg(),
					"校验message");

			Logger.verifyNotNull(v1getorderlistCall.getContent(), "校验content");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_V1getorderdetail_002() {
		Logger.start(true, "openapi获取订单详情,该订单不是买手的订单");
		try {

			/*			PlaceOrderResp placeOrderResp = PlaceOrderService
								.placeOrderWithOutCoupon();

						int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
						int orderId = placeOrderResp.getOrderList().get(0).getOrderId();
			*/
			openApiGetOrderReq.setOrder_id(112531259);

			Application application = openApiWapper
					.selectApplicationBySellerId(3383L).get(0);

			String app_id = application.getApp_id();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);

			String app_secret = application.getApp_secret();

			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(openApiGetOrderReq));
			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.order.detail.get",
							app_id);

			v1getorderlistCall.setUrl(url);

			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			v1getorderlistCall.setData(openapiReq);

			v1getorderlistCall.callService();

			Logger.verifyEquals("0000", v1getorderlistCall.getCode(), "校验code");
			Logger.verifyEquals("null", v1getorderlistCall.getMsg(),
					"校验message");

			DataUtil.verify(null,
					v1getorderlistCall.getContent().get("order_info"),
					"校验content");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_V1getorderdetail_003() {
		Logger.start(true, "openapi获取订单详情,订单号不存在");
		try {

			/*			PlaceOrderResp placeOrderResp = PlaceOrderService
								.placeOrderWithOutCoupon();

						int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
						int orderId = placeOrderResp.getOrderList().get(0).getOrderId();
			*/
			openApiGetOrderReq.setOrder_id(11111111);

			Application application = openApiWapper
					.selectApplicationBySellerId(3383L).get(0);

			String app_id = application.getApp_id();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);

			String app_secret = application.getApp_secret();

			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(openApiGetOrderReq));
			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.order.detail.get",
							app_id);

			v1getorderlistCall.setUrl(url);

			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			v1getorderlistCall.setData(openapiReq);

			v1getorderlistCall.callService();

			Logger.verifyEquals("0000", v1getorderlistCall.getCode(), "校验code");
			Logger.verifyEquals("null", v1getorderlistCall.getMsg(),
					"校验message");

			DataUtil.verify(null,
					v1getorderlistCall.getContent().get("order_info"),
					"校验content");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_V1getorderdetail_004() {
		Logger.start(true, "openapi获取订单详情,订单号为null");
		try {

			/*			PlaceOrderResp placeOrderResp = PlaceOrderService
								.placeOrderWithOutCoupon();

						int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
						int orderId = placeOrderResp.getOrderList().get(0).getOrderId();
			*/
			//openApiGetOrderReq.setOrder_id(11111111);

			Application application = openApiWapper
					.selectApplicationBySellerId(3383L).get(0);

			String app_id = application.getApp_id();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);

			String app_secret = application.getApp_secret();

			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(openApiGetOrderReq));
			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.order.detail.get",
							app_id);

			v1getorderlistCall.setUrl(url);

			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			v1getorderlistCall.setData(openapiReq);

			v1getorderlistCall.callService();

			Logger.verifyEquals("0001", v1getorderlistCall.getCode(), "校验code");
			Logger.verifyEquals("orderId:订单ID非法", v1getorderlistCall.getMsg(),
					"校验message");

			Logger.verifyIsNull(v1getorderlistCall.getContent(), "校验content");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_V1getorderdetail_005() {
		Logger.start(true, "openapi获取订单详情,订单为已接单");
		try {

			PlaceOrderResp placeOrderResp = PlaceOrderService.acceptOrder();

			int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
			int orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			openApiGetOrderReq.setOrder_id(orderId);

			Application application = openApiWapper
					.selectApplicationBySellerId(Long.valueOf(sellerId)).get(0);

			String app_id = application.getApp_id();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);

			String app_secret = application.getApp_secret();

			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(openApiGetOrderReq));
			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.order.detail.get",
							app_id);

			v1getorderlistCall.setUrl(url);

			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			v1getorderlistCall.setData(openapiReq);

			v1getorderlistCall.callService();

			Logger.verifyEquals("0000", v1getorderlistCall.getCode(), "校验code");
			Logger.verifyEquals("null", v1getorderlistCall.getMsg(),
					"校验message");

			Logger.verifyNotNull(v1getorderlistCall.getContent(), "校验content");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	@Ignore
	public void Tc_V1getorderdetail_006() {
		Logger.start(true, "openapi获取订单详情-stg");
		try {

			String appId = "6QcDcCtvV3pJknJUEp";
			String app_secret = "95605832511B6C85DB2D0FA9E3ACBB61FE3E1730322EF9CCA09E7ED5E523721461BEC16080D01798E84218559F4A6177";
			String auth_code = "2teKsa6gaiSUwxsACry9hXIaVsTEXqqV";

			openApiGetOrderReq.setOrder_id(123552539);

			openapiReq.setApp_id(appId);
			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(auth_code);
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(openApiGetOrderReq));
			String url = String
					.format("http://open.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.order.detail.get",
							appId);

			v1getorderlistCall.setUrl(url);

			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			v1getorderlistCall.setData(openapiReq);

			v1getorderlistCall.callService();

			Logger.verifyEquals("0000", v1getorderlistCall.getCode(), "校验code");
			Logger.verifyEquals("null", v1getorderlistCall.getMsg(),
					"校验message");

			Logger.verifyNotNull(v1getorderlistCall.getContent(), "校验content");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_V1getorderdetail_007() {
		Logger.start(true, "openapi 发货后,获取订单详情 查询物流信息");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);
			
			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();
			
			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();
			
			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingCallService.delivery(sellerId, orderId, LogisticsTypeEnum.US, 1);

			openApiGetOrderReq.setOrder_id(1743888699);
			openApiGetOrderReq.setNeeds_delivery_info(true);

			Application application = openApiWapper
					.selectApplicationBySellerId(Long.valueOf(sellerId)).get(0);

			String app_id = application.getApp_id();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);

			String app_secret = application.getApp_secret();

			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(openApiGetOrderReq));
			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.order.detail.get",
							app_id);

			v1getorderlistCall.setUrl(url);

			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			v1getorderlistCall.setData(openapiReq);

			v1getorderlistCall.callService();

			Logger.verifyEquals("0000", v1getorderlistCall.getCode(), "校验code");
			Logger.verifyEquals("null", v1getorderlistCall.getMsg(),
					"校验message");

			Logger.verifyNotNull(v1getorderlistCall.getContent(), "校验content");

			Logger.info(v1getorderlistCall.getorderdetailResponse()
					.getOrderInfo().getDelivery_info().size());

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_V1getorderdetail_008() {
		Logger.start(true, "openapi 国内段发货后,获取订单详情 查询物流信息");
		try {

			TradingServiceResp placeOrderResp = TradingPlaceOrderCallService
					.placeOrderWithLogisticsType(LogisticsTypeEnum.OVERSEAS_DELIVERY);
			
			long sellerId = placeOrderResp.getOrderList().get(0).getSellerId();

			long orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			long userId = placeOrderResp.getUserId();

			long tradingId = placeOrderResp.getTradingId();
			
			BigDecimal useAccountAmount = placeOrderResp.getPayableAmount();
			
			TradingCallService.payOrder(userId, useAccountAmount, tradingId);

			TradingCallService.sellerAcceptOrder(sellerId, orderId);
			TradingCallService.delivery(sellerId, orderId, LogisticsTypeEnum.PackageDelivery, 1);
			TradingCallService.delivery(sellerId, orderId, LogisticsTypeEnum.PackageDelivery, 3);

			openApiGetOrderReq.setOrder_id(orderId);
			openApiGetOrderReq.setNeeds_delivery_info(true);

			Application application = openApiWapper
					.selectApplicationBySellerId(Long.valueOf(sellerId)).get(0);

			String app_id = application.getApp_id();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);

			String app_secret = application.getApp_secret();

			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(openApiGetOrderReq));
			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.order.detail.get",
							app_id);

			v1getorderlistCall.setUrl(url);

			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			v1getorderlistCall.setData(openapiReq);

			v1getorderlistCall.callService();

			Logger.verifyEquals("0000", v1getorderlistCall.getCode(), "校验code");
			Logger.verifyEquals("null", v1getorderlistCall.getMsg(),
					"校验message");

			Logger.verifyNotNull(v1getorderlistCall.getContent(), "校验content");

			Logger.info(v1getorderlistCall.getorderdetailResponse()
					.getOrderInfo().getDelivery_info().size());

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_V1getorderdetail_009() {
		Logger.start(true, "openapi 发货后 没有物流单号,获取订单详情 查询物流信息");
		try {

			PlaceOrderResp placeOrderResp = PlaceOrderService.dispatchedOrder();

			int sellerId = placeOrderResp.getOrderList().get(0).getSellerId();
			int orderId = placeOrderResp.getOrderList().get(0).getOrderId();

			SyncVerifyService.getSyncResult(orderId);

			openApiGetOrderReq.setOrder_id(orderId);
			openApiGetOrderReq.setNeeds_delivery_info(true);

			Application application = openApiWapper
					.selectApplicationBySellerId(Long.valueOf(sellerId)).get(0);

			String app_id = application.getApp_id();

			AuthCode authCode = openApiWapper.selectAuthCodeByAppId(app_id)
					.get(0);

			openapiReq.setApp_id(app_id);

			String app_secret = application.getApp_secret();

			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(authCode.getAuth_code());
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(openApiGetOrderReq));
			String url = String
					.format("http://apigateway.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.order.detail.get",
							app_id);

			v1getorderlistCall.setUrl(url);

			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			v1getorderlistCall.setData(openapiReq);

			v1getorderlistCall.callService();

			Logger.verifyEquals("0000", v1getorderlistCall.getCode(), "校验code");
			Logger.verifyEquals("null", v1getorderlistCall.getMsg(),
					"校验message");

			Logger.verifyNotNull(v1getorderlistCall.getContent(), "校验content");

			Logger.verifyIsNull(v1getorderlistCall.getorderdetailResponse()
					.getOrderInfo().getDelivery_info(), "校验delivery_info");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}

	@Test
	@Category({P1.class})
	@TestCase
	@Ignore
	public void Tc_V1getorderdetail_010() {
		Logger.start(true, "openapi获取订单详情-stg");
		try {

			String app_id = "0Y6XVHaj7kjsoEcvGg";
			String app_secret = "5340AA34A5D6A154066F5074B31BA672149B88B399F6611450BB931952F3EE3277A049D2CAB92FF1E467219E19726988";
			String auth_code = "04MvSmEWQvF07g4U98uHsViKAJYlot5r";

			openApiGetOrderReq.setOrder_id(129443951);

			openapiReq.setApp_id(app_id);
			openapiReq.setSign_method("MD5");
			openapiReq.setAuth_code(auth_code);
			openapiReq.setTimestamp(YMTDateUtil.getSysTime());
			openapiReq.setNonce_str(TestDataManager.getRandomNum(31));
			openapiReq.setBiz_content(new FormatUtil()
					.beanToGSONString(openApiGetOrderReq));
			String url = String
					.format("http://open.ymatou.com/apigateway/v1?app_id=%s&method=ymatou.order.detail.get",
							app_id);

			v1getorderlistCall.setUrl(url);

			openapiReq.setSign(OpenapiService.generateMD5(openapiReq,
					AesUtil.decrypt(app_secret)));

			v1getorderlistCall.setData(openapiReq);

			v1getorderlistCall.callService();

			Logger.verifyEquals("0000", v1getorderlistCall.getCode(), "校验code");
			Logger.verifyEquals("null", v1getorderlistCall.getMsg(),
					"校验message");

			Logger.verifyNotNull(v1getorderlistCall.getContent(), "校验content");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}